<?php
/**
 * Created by Shauan Andrade.
 * User: shauan
 * Date Time: 18/05/13 | 12:36
 * Project: yonkou
 */

App::uses('AppHelper','View/Helper');
class MsgHelper extends AppHelper {

    public function showMsg($value = array())
    {
        $_close = '';

        if(!empty($value) && $value == null){
            if(is_array($value))
            {
                if($value['close'] == true)
                {
                    $_close = '<button type="button" class="close" data-dismiss="alert">&times;</button>';
                }
                return $this->Session->setFlash($_close.$value['title'].$value['message'],'default',array('escape'=>false,'class'=>'alert alert-'.$value['type']));
            }
        }
    }

}